package com.neusoft.ysu.his.mapper;

import com.neusoft.ysu.his.entity.Register;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 作者：赵子鉴
 * @since 2023-08-29
 */
@Mapper
public interface RegisterMapper extends BaseMapper<Register> {
    @Select("select * from register where regnum=#{regnum}")
    Register findByRegnum(int regnum);

    @Select("select * from register where name like '%#{name}%'")
    Register findByName(int name);

    @Update("UPDATE register set loginname=#{loginname}, name=#{name}, password=#{password} where regnum=#{regnum};")
    int updateByregnum(Register register);

    @Update("UPDATE register set delmark=#{delmark} where regnum=#{regnum}")
    int deleteByregnum(Register register);

    @Select("select * from register where loginname=#{loginname} AND password=#{password}")
    Register loginCheck(Register register);

}
